#ifndef __EVENT_H__
#define __EVENT_H__

#define EV_INIT         0x00
#define EV_ACTIVE	0x01
#define EV_READ         0x02
#define EV_WRITE        0x04
#define EV_TIMEOUT      0x08


struct event_s;
struct event_ops_s;
struct event_base_s;

#ifdef __cplusplus
extern "C" {
#endif

int	event_base_new( int max_event, int max_timer, const char *log_fn );
void    event_base_delete( );
void    event_base_active( struct event_base_s *base, struct event_s *ev, short flags );
struct event_s* event_base_array_get( struct event_base_s *base, int idx );
struct event_s *event_new();
void    event_free( struct event_s *ev );
void    event_set( struct event_s *ev, int fd, short events, void  (*handle)( int fd, short flags, void *arg ), void *arg );
int     event_add( struct event_s *ev, int timeout/* per second */ );
void    event_del( struct event_s *ev );
void    event_dispatch( int timeout );


#ifdef __cplusplus
} /* end of extern "C" */
#endif


#endif
